﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebshopPizzaRio.App_Code.BLL;
using System.Web.Security;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace WebshopPizzaRio
{
    public partial class Userpanel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PizzaBLL pbbl = new PizzaBLL();
            MembershipUser currentuserid = Membership.GetUser();

            try
            {
                if ((Guid)currentuserid.ProviderUserKey == null)
                {
                    throw new NullReferenceException();
                }
            }
            catch (NullReferenceException)
            {
                Response.Redirect("Voorpagina.aspx");
            }

            Guid userid = (Guid)currentuserid.ProviderUserKey;
            samengesteldepizza_LV.DataSource = pbbl.getPizzaByUserID(userid);
            samengesteldepizza_LV.DataBind();
        }

        protected void FormView1_PageIndexChanging(object sender, FormViewPageEventArgs e)
        {

        }

    }
}